package com.dkd;

import java.util.Scanner;

public class Main {
    //冒泡排序
    public static void main(String[] args) {
        //Scanner sc = new Scanner(System.in);
      //  int n = sc.nextInt();
       // String[] s0= new String[n];
        int n = 5;
        String[] s0= {"c","d","a","bb","e"};
      //  for(int i=0;i<n;i++){
        //    s0[i]= sc.next();
        //}
        for(int i=0;i<n;i++){
            for(int j=i+1;j<n;j++){
                String s1 = s0[i];
                String s2 =s0[j];
                if(max(s1,s2)){
                    String temp;
                    temp = s0[i];
                    s0[i] = s0[j];
                    s0[j] = temp;
                }

            }
            System.out.println(s0[i]);
        }

        for(int i=0;i<n;i++){
            System.out.println(s0[i]);
        }
        System.out.println(max("a","bb"));
        System.out.println(max("a","c"));
    }

    public static Boolean max(String s1,String s2){
        int n = s1.length();
        int m = s2.length();
        int i = 0;
        while (i < n && i < m) {
            if (s1.charAt(i) > s2.charAt(i)) {
                return true;  // s1 > s2
            }
            if (s1.charAt(i) < s2.charAt(i)) {
                return false;  // s1 < s2
            }
            i++;
        }
        if (n > m) {
            return true;  // s1 更长
        }
        if (n < m) {
            return false;  // s1 更短
        }
        return true;
    }
}
